package com.fcscs.cservice.ws.client.inroomservice;

import org.apache.log4j.Logger;
import org.springframework.ws.client.core.support.WebServiceGatewaySupport;

import com.fcscs.cservice.ws.schema.inroomservice.CalculateOrderRequest;
import com.fcscs.cservice.ws.schema.inroomservice.CalculateOrderResponse;

public class CalculateOrderClient extends WebServiceGatewaySupport {

	private static final Logger LOG = Logger.getLogger(CalculateOrderClient.class);

	public CalculateOrderResponse calculateOrder(CalculateOrderRequest req) {
		CalculateOrderResponse resp = (CalculateOrderResponse)getWebServiceTemplate().marshalSendAndReceive(req);
		LOG.info("---------- CalculateOrderResponse: " + (resp.getOrderView() == null ? 0 : resp.getOrderView().getAmount()));
		return resp;
	}
}
